import java.util.Arrays;
import java.util.Comparator;

import org.junit.Test;

public class Test1{
    @Test
    public void test1(){
        Person[] person=new Person[3];
        person[1]=new Person("Tom", 11);
        person[2]=new Person("Ally", 12);
        person[0]=new Person("Milke", 13);
        //Arrays.sort(person);
        Arrays.sort(person, new Comparator(){
            @Override
            public int compare(Object o1, Object o2) {
                if(o1 instanceof Person && o2 instanceof Person){
                    Person person1=(Person) o1;
                    Person person2=(Person) o2;
                    return -person1.compareTo(person2);
                }
                throw();
            }
        });
        for (Person person1 : person) {
            System.out.println(person1.getInfo());
        }
    }
}